package com.github.brainlag.nsq.lookup;

import com.github.brainlag.nsq.ServerAddress;
import com.google.common.collect.Sets;

import java.util.Set;

public class LocalLookup implements NSQLookup {
    private int port;

    public LocalLookup(int port){
        this.port = port;
    }
    @Override
    public void addLookupAddress(String addr, int port) {
    }

    @Override
    public Set<ServerAddress> lookup(String topic) {
        Set<ServerAddress> addresses = Sets.newHashSet();
        ServerAddress address = new ServerAddress("127.0.0.1", this.port );
        addresses.add(address);
        return addresses;
    }
}
